package com.ionehe.esjob;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import com.ionehe.annotation.ElasticJobConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@ElasticJobConfig(
        name = "com.ionehe.esjob.TestJob2",
        cron = "0/10 * * * * ?", //10秒钟一次
        description = "测试定时任务2",
        overwrite = true,
        shardingTotalCount = 2
)
@Slf4j
public class TestJob2 implements SimpleJob {
    @Override
    public void execute(ShardingContext shardingContext) {
        log.info("执行测试job2");
    }
}